package com.qf.day06.homework;

public class Warrior extends Hero{
    public Warrior(String name, int power, int iq, int quick,int angry) {
        super(name, power, iq, quick);
        this.angry=angry;
    }
    // 独有的属性，怒气值
    private int angry;

    public int getAngry() {
        return angry;
    }

    public void setAngry(int angry) {
        this.angry = angry;
    }
    //独有的方法，英勇打击，（攻击力=力量的上下百分之20*2，消耗20怒气）。
    public void HeroicBlows(){
        System.out.println(getName()+"进行了一次英勇打击！");
        this.setPower((int) ((this.getPower() * 0.2) * 2));
        System.out.println("power:"+ getPower());
        this.angry =this.angry-20;
        System.out.println("angry:"+ angry);
    }

    @Override
    public String toString() {
        return "Warrior{" +
                "name='" + getName() + '\'' +
                ", power=" + getPower() +
                ", iq=" + getIq() +
                ", quick=" +getQuick() +
                ", angry=" + angry +
                '}';
    }
}
